<template>
  <div class="user">
    <div class="top">
      <div class="img"></div>
      <h3>lixin</h3>
    </div>

    <div class="btn" @click="exit">退出登录</div>
  </div>
</template>

<script>
export default {
  name: "HmUser",
  methods: {
    exit() {
      localStorage.removeItem("token");
      this.$router.push("/login");
    },
  },
};
</script>

<style lang="less" scoped>
.user {
  padding: 10px 10px;
  background-color: #f5f5f5;
  .top {
    display: flex;
    align-items: center;
    .img {
      width: 70px;
      height: 70px;
      background-size: contain;
      background-image: url("../assets/logo.png");
      margin-right: 30px;
      background-position: center;
      background-color: #fff;
      border-radius: 50%;
    }
  }
  .btn {
    width: 100%;
    height: 40px;
    line-height: 40px;
    background-color: red;
    color: #fff;
    text-align: center;
    margin-top: 20px;
    border-radius: 5px;
    cursor: pointer;
    &:hover {
      background-color: #fff;
      color: red;
    }
  }
}
</style>
